package com.zhongyi.ui;

import com.zhongyi.dao.IAccountDao;
import com.zhongyi.service.IAccountService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class Client {
    public static void main(String[] args) {

        ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");

        IAccountDao dao = (IAccountDao) ac.getBean("accountDao");
        System.out.println(dao);

        IAccountService service = (IAccountService) ac.getBean("accountService");
        System.out.println(service);


        Resource resource = new ClassPathResource("bean.xml");
        BeanFactory factory = new XmlBeanFactory(resource);


    }
}
